 const bcrypt = require('bcryptjs');

 let oldwrod = '741165zks';
 //给密码加密 (加密的数据，加密复杂度 建议10)
 oldwrod = bcrypt.hashSync(oldwrod, 10);
 console.log(oldwrod);
 //比较
 let newword = '741165zks'

 //compareSync 参数(用户输入的数据，要比较的数据)
 const result = bcrypt.compareSync(newword, oldwrod);
 console.log(result);
 if (result) {
     return console.log('登录成功');
 }
 console.log('登录失败');